//app.js
App({
  data:{
    name:"sam"
  },
  onLaunch: function(options) {
    console.log("小程序启动成功", options);
  },
  onShow: function(options) {
    console.log("切到前台", options);
    switch (options.scene) {
      case 1011:
        console.log("扫描二维码");
        break;
      case 1019:
        console.log("微信钱包");
        break;
    }
  },
  onHide: function() {
    console.log("切到后台");
  },
  onError: function() {},
  user: {
    name: "tom"
  },
  globalData: {
    userInfo: null
  }

})